package cn.yinzhiping.rabbbitmqlearn.controller;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;

/**
 * 生产者
 * @author yinzhiping
 */
@RestController
public class PublisherController {
    @Autowired
    RabbitTemplate rabbitTemplate;
    @RequestMapping("/pub")
    public void testHelloWord(){
        for (int i = 0; i < 20; i++) {
            rabbitTemplate.convertAndSend("hello",i+"::::--hello rabbitMQ!");
        }

    }
}
